target = client_thread
srcs = dispatch_server.cpp calc_server.cpp\
	   group_id_message.cpp gf_data_message.cpp lf_data_message.cpp text_label_message.cpp color_label_message.cpp npx_message.cpp image_quality_message.cpp image_splicing_message.cpp a_image_message.cpp dominant_color_message.cpp\
	   i_dont_known_opencv.cpp client_thread.cpp misc_configs.cpp

libs = dip/gf/lib/libGlobalFeature_2_0_3.a dip/gf/input/lib/libAutoJudgeImage.a dip/gf/input/lib/libCenterExtract.a dip/gf/input/lib/libClusterSplitter.a dip/gf/input/lib/libInvertedFileIndex.a \
	   dip/lf/lib/libLocalFeaturesRuku_1_0_2.a dip/lf/lib/libLocalFeaturesExtracter_1_0_2.a dip/lf/lib/libClusteringLibrary.a dip/lf/lib/libSalientMap.a \
	   dip/tv/lib/libTVMergeV1_0_2.a dip/tv/lib/libInvertedFileIndex.a dip/tv/lib/libSegmenter.a dip/tv/lib/libAliWS.a\
	   dip/autolabel/lib/libautoLabel_1_0_1.a\
	   dip/npx/lib/libNPXFilterV1_1_0.a\
	   dip/iq/lib/libImageQualityV1_1_1.a dip/iq/lib/libSalientMap.a\
	   dip/image_splicing/lib/libImageSplicing_1_0_0.a dip/image_splicing/input/lib/libSalientMap.a\
	   dip/a_image/lib/libImageTypeAJudge_2_0_0.a\
	   dce/libdce.a  log/lib/liblog.a

subdirs= dce log

INCLUDE= -Idip/gf/include -Idip/lf/include -Idip/tv/include -Idip/autolabel/include -Idip/npx/include -Idip/iq/include -Idip/image_splicing/include -Idip/a_image/include\
		 -Iopencv/inc -Iutils/ -Idce/ -I./ -Ixml/ -Ilog/include/

LIBRARY=-lpthread  -lxml2 -lcv -lhighgui -ldb -lcxcore -lssl -lml -lcvaux #-ltiff
CPPFLAGS+=-g -Lxml/lib/ -Lopencv/lib/ -fpic
all : $(target)

objs=$(patsubst %.cpp, %.o, $(srcs))

all : $(target)

$(target) : $(objs) 
	for dir in $(subdirs); do make -C $$dir ; done
	g++ $(CPPFLAGS) $(INCLUDE) -o $(target) $^ $(libs) $(LIBRARY) 

%.o : %.cpp
	g++ $(INCLUDE) $(CPPFLAGS) $< -c -o $@

.PHONY : clean sclean
clean:
	for dir in $(subdirs); do make -C $$dir clean; done
	rm -f $(objs)
	rm -f $(target)
sclean:
	rm -f $(objs)
	rm -f $(target)
